<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use \think\facade\Route;


Route::group('api',function (){
    Route::group('admin',function (){
        //添加权限
       Route::post('addPermission','admin/PermissionController/addPermission')->middleware('LoginAuth');

       Route::get('getPermissionOption','admin/PermissionController/getPermissionOption')->middleware('LoginAuth');
       //获取列表
       Route::get('getPermission','admin/PermissionController/getPermission')->middleware('LoginAuth');
       //切换展示状态
       Route::post('CheckPermissionShow','admin/PermissionController/CheckPermissionShow')->middleware('LoginAuth');
       //是否有效
       Route::post('CheckPermissionStatus','admin/PermissionController/CheckPermissionStatus')->middleware('LoginAuth');
       //更新权限
       Route::post('updatePermission','admin/PermissionController/updatePermission')->middleware('LoginAuth');
       //删除权限
       Route::post('deletePermission','admin/PermissionController/deletePermission')->middleware('LoginAuth');
       //获取权限树
        Route::get('GetPermissionTree','admin/PermissionController/GetPermissionTree')->middleware('LoginAuth');

       //获取角色选项
        Route::get('GetRoleOption','admin/RoleController/GetRoleOption')->middleware('LoginAuth');
        //添加角色
        Route::post('addRole','admin/RoleController/addRole')->middleware('LoginAuth');
        //获取角色列表
        Route::get('GetRoleList','admin/RoleController/GetRoleList')->middleware('LoginAuth');
        //获取已勾选权限
        Route::get('GetCheckedTree','admin/RoleController/GetCheckedTree')->middleware('LoginAuth');
        //切换角色状态
        Route::post('CheckRoleStatus','admin/RoleController/CheckRoleStatus')->middleware('LoginAuth');
        //更新角色
        Route::post('updateRole','admin/RoleController/updateRole')->middleware('LoginAuth');
        //删除角色
        Route::post('DelRole','admin/RoleController/DelRole')->middleware('LoginAuth');

        Route::get('GetRoleAll','admin/RoleController/GetRoleAll')->middleware('LoginAuth');

        //图片上传
        Route::post('upload','admin/UploadController/upload')->middleware('LoginAuth');

        //配置文件
        Route::post('SetConf','admin/ConfigController/SetConf')->middleware('LoginAuth');
        Route::get('GetConf','admin/ConfigController/GetConf')->middleware('LoginAuth');

        //添加账号
        Route::post('addUser','admin/UserController/addUser')->middleware('LoginAuth');
        //获取列表
        Route::get('getUserList','admin/UserController/getUserList')->middleware('LoginAuth');
        //切换状态
        Route::post('CheckUserStatus','admin/UserController/CheckUserStatus')->middleware('LoginAuth');
        //更新账号
        Route::post('updateUser','admin/UserController/updateUser')->middleware('LoginAuth');
        //删除账号
        Route::post('deleteUser','admin/UserController/deleteUser')->middleware('LoginAuth');


        //登陆
        Route::post('Login','admin/LoginController/Login');
        Route::post('getUserInfo','admin/LoginController/getUserInfo');
        Route::post('LoginOut','admin/LoginController/LoginOut');

    });


});

Route::get('/admin',function (){
    return redirect('/dist');
});
